package com.design.observer;

/**
 * Created by yijy on 2018/4/19.
 */
public class Test {

    public static void main(String[] args) {
        WechatServer wechatServer = WechatServer.getWechatServer();
        User user = new User("张三");
        User user1 = new User("李四");
        User user2 = new User("王五");
        wechatServer.registerObserver(user);
        wechatServer.registerObserver(user1);
        wechatServer.registerObserver(user2);
        wechatServer.setInfomation("JAVA是世界上最好用的语言！");
        System.out.println("------------------------------");
        wechatServer.removeObserver(user);
        wechatServer.setInfomation("张三这个2货取关了？");
    }

}
